﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Homework4
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] numbers = { 97, 65, 32, 17, 58, 43, 79, 81, 23, 10 };
            for (int i = 0; i < numbers.Length-1; i++)
            {
                for (int j = 0; j < numbers.Length-i-1; j++)
                {
                    if (numbers[j]>numbers[j+1])
                    {
                        int t = numbers[j+1];
                        numbers[j + 1] = numbers[j];
                        numbers[j] = t;
                    }
                }
            }
            Console.WriteLine("数组中的最大数为：" + numbers[numbers.Length - 1]);
            Console.WriteLine("数组中的最小数为：" + numbers[0]);
            Console.Write("排序后的数组：" );
            foreach (int item in numbers)
            {
                Console.Write(item+" ");
            }
            Console.ReadKey();
        }
    }
}
